package dk.dashboardFP.panels.settingspanel.info {
	import dk.dashboardFP.DashboardFP;
	import dk.dashboardFP.elements.IElement;
	import dk.dashboardFP.elements.IElementHolder;
	import dk.dashboardFP.panels.subPanels.ui.windowSubPanelUI.IWindowContent;
	import dk.dashboardFP.panels.subPanels.ui.windowSubPanelUI.WindowContentEvent;

	import flash.display.DisplayObject;
	import flash.display.Sprite;
	import flash.geom.Point;

	/**
	 * @author josef
	 */
	public class InfoWindowContent extends Sprite implements IWindowContent,IElementHolder {
		private var _countY : int;
		private var _spaceHeight : int = 6;
		private var _elements : Array;

		public function InfoWindowContent() {
			setupElements();
		}

		//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
		// setup
		//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

		private function setupElements() : void { 
			
			// elemtns 
			_elements=[];
			
			// initial 
			_countY = 5;

			addElement(new InfoValueLine("DashboardFP", DashboardFP.VERSION));
			_countY += _spaceHeight;
		
			// add screen res
			addElement(new SystemInfo());

			_countY += _spaceHeight;

			addElement(new ScreenSizeInfo());
			addElement(new StageSizeInfo());
			
			_countY += _spaceHeight;
			
			addElement(new StageAlignInfo());
			addElement(new StageScaleModeInfo());
			
			_countY += _spaceHeight;
			
			addElement(new FontInfo());
			 
			// init 
			dispatchEvent(new WindowContentEvent(WindowContentEvent.CONTENT_DIMENTIONS_CHANGE));
		}

		//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
		// interface
		//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

		public function setWindowDimentions(pWindowDimentions : Point) : void {
		}

		public function set nWindowWidth(nWindowWidth : Number) : void {
		}

		public function set nWindowHeight(nWindowHeight : Number) : void {
		}

		public function addElement(oElement : IElement) : IElement {
			
			_elements.push(oElement);
			
			oElement.y = _countY;
			oElement.x = 5;
			
			_countY = oElement.nBottomLine;
			
			addChild(oElement as DisplayObject);
			
			return oElement;
		}
	}
}
